package com.gaofeng.day09;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Consumer;

public class Demo05 {
    public static void main(String[] args) {
        // 匿名内部类
        Collection<String> coll = new ArrayList<>();
        coll.add("aaa");
        coll.add("bbb");
        coll.add("ccc");
        System.out.println(coll);
        coll.forEach(new Consumer<String>() {
            @Override
            public void accept(String s) {
                System.out.println(s);
            }
        });
        // lambda表达式
        //coll.forEach(System.out::println);
     }
}
